Optimal. Leaf size=222 \[ \frac {a^2 (14 A+12 B+11 C) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac {a^2 (10 A+9 B+8 C) \tan (c+d x)}{5 d}+\frac {a^2 (14 A+12 B+11 C) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 (10 A+12 B+9 C) \sec ^3(c+d x) \tan (c+d x)}{40 d}+\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {(3 B+C) \sec ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{15 d}+\frac {a^2 (10 A+9 B+8 C) \tan ^3(c+d x)}{15 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.30, antiderivative size = 222, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.171, Rules used = {4173, 4103,
4082, 3872, 3853, 3855, 3852} \begin {gather*} \frac {a^2 (10 A+9 B+8 C) \tan ^3(c+d x)}{15 d}+\frac {a^2 (10 A+9 B+8 C) \tan (c+d x)}{5 d}+\frac {a^2 (14 A+12 B+11 C) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac {a^2 (10 A+12 B+9 C) \tan (c+d x) \sec ^3(c+d x)}{40 d}+\frac {a^2 (14 A+12 B+11 C) \tan (c+d x) \sec (c+d x)}{16 d}+\frac {(3 B+C) \tan (c+d x) \sec ^3(c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{15 d}+\frac {C \tan (c+d x) \sec ^3(c+d x) (a \sec (c+d x)+a)^2}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3852
Rule 3853
Rule 3855
Rule 3872
Rule 4082
Rule 4103
Rule 4173
Rubi steps
\begin {align*} \int \sec ^3(c+d x) (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {\int \sec ^3(c+d x) (a+a \sec (c+d x))^2 (3 a (2 A+C)+2 a (3 B+C) \sec (c+d x)) \, dx}{6 a}\\ &=\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {(3 B+C) \sec ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{15 d}+\frac {\int \sec ^3(c+d x) (a+a \sec (c+d x)) \left (3 a^2 (10 A+6 B+7 C)+3 a^2 (10 A+12 B+9 C) \sec (c+d x)\right ) \, dx}{30 a}\\ &=\frac {a^2 (10 A+12 B+9 C) \sec ^3(c+d x) \tan (c+d x)}{40 d}+\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {(3 B+C) \sec ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{15 d}+\frac {\int \sec ^3(c+d x) \left (15 a^3 (14 A+12 B+11 C)+24 a^3 (10 A+9 B+8 C) \sec (c+d x)\right ) \, dx}{120 a}\\ &=\frac {a^2 (10 A+12 B+9 C) \sec ^3(c+d x) \tan (c+d x)}{40 d}+\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {(3 B+C) \sec ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{15 d}+\frac {1}{5} \left (a^2 (10 A+9 B+8 C)\right ) \int \sec ^4(c+d x) \, dx+\frac {1}{8} \left (a^2 (14 A+12 B+11 C)\right ) \int \sec ^3(c+d x) \, dx\\ &=\frac {a^2 (14 A+12 B+11 C) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 (10 A+12 B+9 C) \sec ^3(c+d x) \tan (c+d x)}{40 d}+\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {(3 B+C) \sec ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{15 d}+\frac {1}{16} \left (a^2 (14 A+12 B+11 C)\right ) \int \sec (c+d x) \, dx-\frac {\left (a^2 (10 A+9 B+8 C)\right ) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{5 d}\\ &=\frac {a^2 (14 A+12 B+11 C) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac {a^2 (10 A+9 B+8 C) \tan (c+d x)}{5 d}+\frac {a^2 (14 A+12 B+11 C) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 (10 A+12 B+9 C) \sec ^3(c+d x) \tan (c+d x)}{40 d}+\frac {C \sec ^3(c+d x) (a+a \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac {(3 B+C) \sec ^3(c+d x) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{15 d}+\frac {a^2 (10 A+9 B+8 C) \tan ^3(c+d x)}{15 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 3.34, size = 359, normalized size = 1.62 \begin {gather*} -\frac {a^2 (1+\cos (c+d x))^2 \left (C+B \cos (c+d x)+A \cos ^2(c+d x)\right ) \sec ^4\left (\frac {1}{2} (c+d x)\right ) \sec ^6(c+d x) \left (15 (14 A+12 B+11 C) \cos ^6(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-40 C \sec (c) \sin (d x)-8 \cos (c+d x) \sec (c) (5 C \sin (c)+6 (B+2 C) \sin (d x))-2 \cos ^3(c+d x) \sec (c) (5 (6 A+12 B+11 C) \sin (c)+8 (10 A+9 B+8 C) \sin (d x))-\cos ^5(c+d x) \sec (c) (15 (14 A+12 B+11 C) \sin (c)+32 (10 A+9 B+8 C) \sin (d x))-2 \cos ^2(c+d x) \sec (c) (24 (B+2 C) \sin (c)+5 (6 A+12 B+11 C) \sin (d x))-\cos ^4(c+d x) \sec (c) (16 (10 A+9 B+8 C) \sin (c)+15 (14 A+12 B+11 C) \sin (d x))\right )}{480 d (A+2 C+2 B \cos (c+d x)+A \cos (2 (c+d x)))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.95, size = 365, normalized size = 1.64 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 477 vs.
\(2 (208) = 416\).
time = 0.30, size = 477, normalized size = 2.15 \begin {gather*} \frac {320 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{2} + 32 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B a^{2} + 160 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} + 64 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} C a^{2} - 5 \, C a^{2} {\left (\frac {2 \, {\left (15 \, \sin \left (d x + c\right )^{5} - 40 \, \sin \left (d x + c\right )^{3} + 33 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} - 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 30 \, A a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, B a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 30 \, C a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 120 \, A a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.84, size = 203, normalized size = 0.91 \begin {gather*} \frac {15 \, {\left (14 \, A + 12 \, B + 11 \, C\right )} a^{2} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (14 \, A + 12 \, B + 11 \, C\right )} a^{2} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (32 \, {\left (10 \, A + 9 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )^{5} + 15 \, {\left (14 \, A + 12 \, B + 11 \, C\right )} a^{2} \cos \left (d x + c\right )^{4} + 16 \, {\left (10 \, A + 9 \, B + 8 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} + 10 \, {\left (6 \, A + 12 \, B + 11 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 48 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) + 40 \, C a^{2}\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int A \sec ^{3}{\left (c + d x \right )}\, dx + \int 2 A \sec ^{4}{\left (c + d x \right )}\, dx + \int A \sec ^{5}{\left (c + d x \right )}\, dx + \int B \sec ^{4}{\left (c + d x \right )}\, dx + \int 2 B \sec ^{5}{\left (c + d x \right )}\, dx + \int B \sec ^{6}{\left (c + d x \right )}\, dx + \int C \sec ^{5}{\left (c + d x \right )}\, dx + \int 2 C \sec ^{6}{\left (c + d x \right )}\, dx + \int C \sec ^{7}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 392, normalized size = 1.77 \begin {gather*} \frac {15 \, {\left (14 \, A a^{2} + 12 \, B a^{2} + 11 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (14 \, A a^{2} + 12 \, B a^{2} + 11 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (210 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 180 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 165 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 1190 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 1020 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 935 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 2580 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 2568 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 1986 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 3180 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 2808 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3006 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 2330 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1860 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1305 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 750 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 780 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 795 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{6}}}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.59, size = 337, normalized size = 1.52 \begin {gather*} \frac {a^2\,\mathrm {atanh}\left (\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (14\,A+12\,B+11\,C\right )}{4\,\left (\frac {7\,A\,a^2}{2}+3\,B\,a^2+\frac {11\,C\,a^2}{4}\right )}\right )\,\left (14\,A+12\,B+11\,C\right )}{8\,d}-\frac {\left (\frac {7\,A\,a^2}{4}+\frac {3\,B\,a^2}{2}+\frac {11\,C\,a^2}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+\left (-\frac {119\,A\,a^2}{12}-\frac {17\,B\,a^2}{2}-\frac {187\,C\,a^2}{24}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {43\,A\,a^2}{2}+\frac {107\,B\,a^2}{5}+\frac {331\,C\,a^2}{20}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (-\frac {53\,A\,a^2}{2}-\frac {117\,B\,a^2}{5}-\frac {501\,C\,a^2}{20}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {233\,A\,a^2}{12}+\frac {31\,B\,a^2}{2}+\frac {87\,C\,a^2}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (-\frac {25\,A\,a^2}{4}-\frac {13\,B\,a^2}{2}-\frac {53\,C\,a^2}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________